#!/usr/bin/env python3

###############################################################################
# Name:         pagurian.py
# Purpose:      An adapter to load the Qt-Designer *.ui file, build a program by MVC.
# Author:       Bright Li
# Modified by:
# Created:      2018-11-12
# Version:      [0.2.0]
# RCS-ID:       $$
# Copyright:    (c) Bright Li
# Licence:      GPLv2
###############################################################################

import sys, traceback
from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget, QPushButton, QMessageBox, QVBoxLayout)

# 以下内容用于动态改写 src.vacwx.UI_Mapping 值
import json
import gui.vacwx
# from src.vacwx import UI_Mapping  # this way will fail to change the global varible
with open("./gui/conf/uimap.json") as fp:
    gui.vacwx.UI_Mapping = json.load(fp)

# 载入静态 *.ui 界面文件
from gui.wx.mainvac import MainWndVac


if __name__ == '__main__':
    try:
        app = QApplication(sys.argv)
        mainwin = MainWndVac()
        sys.exit(app.exec_())
    except Exception as e:
        # LOG.error(e)
        traceback.print_exc()
        sys.exit(-1)
